﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Cart_New.ascx.cs" Inherits="UserControls_Cart_New" %>
<%@ Register Src="Page.ascx" TagName="Page" TagPrefix="uc1" %>
<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="Style/common.css" rel="stylesheet" type="text/css" />
<link href="Style/shoppingcart.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/Shop.js"></script>

<script language="javascript" type="text/javascript">

    function updateQuantity(obj)//修改数量
    {    
        var CartType = document.getElementById('<%=this.hCartType.ClientID %>').value;  //哪个购物车        
        var proid = document.getElementById('<%=this.hID.ClientID%>').value;
        var quantity = obj;
        
        if(CartType == "carList2")
        {
            Common.updateQuantity(proid,quantity,"carList2");
            window.location="Default.aspx?PN=cart&CartType=carList2";
        }
        else
        {
            Common.updateQuantity(proid,quantity,"carList");
            window.location="Default.aspx?PN=cart";
        }
     }
     
    function reMoveOne(proid)//删除
    {
        var CartType = document.getElementById('<%=this.hCartType.ClientID %>').value;  //哪个购物车
    
        if(CartType == "carList2")
        {
            Common.reMoveOne(proid,"carList2");
            window.location="Default.aspx?PN=cart&CartType=carList2";
        }
        else
        {
            Common.reMoveOne(proid,"carList");
            window.location="Default.aspx?PN=cart";
        }
    }
    function Del()//清空
    {
        var CartType = document.getElementById('<%=this.hCartType.ClientID %>').value;  //哪个购物车
    
        if(CartType == "carList2")
        {
            cookie.Del("carList","/");
            window.location="Default.aspx?PN=cart&CartType=carList2";
        }
        else
        {
            cookie.Del("carList","/");
            window.location="Default.aspx?PN=cart";
        }
    }
</script>

<table border="0" cellpadding="0" cellspacing="0" id="tabctr" runat="server" width="800">
    <tr>
        <td bgcolor="#FFFFFF" align="left">
            <div>
                <!--控件头部-->
                <div id="Top1_order_step1" class="Header_cart">
                    <!--公司网站图片-->
                   
                    <ul class="Order_cart" id="Order_cart_S1">
                        <li class="step1">1.我的购物车</li>
                        <li class="step2">2.填写核对订单信息</li>
                        <li class="step3">3.成功提交订单</li>
                    </ul>
                </div>
                <%--<div id='stockErrorPanel'>
                    <img alt="我的购物车" src="images/UserControls/cart_001.jpg" />
                </div>--%>
                <div class="List_cart">
                    <h2>
                        <strong>我挑选的商品</strong></h2>
                    <div class="cart_table">
                        <!--商品列表开始-->
                        <table width="100%">
                            <tr>
                                <td bgcolor="#FFFFFF">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align: left;">
                                        <tr>
                                            <td bgcolor="#ffffff">
                                                <asp:GridView ID="gvGood" runat="server" AutoGenerateColumns="False" Style="text-align: center"
                                                    Width="100%" DataKeyNames="ID" OnRowDataBound="gvGood_RowDataBound" AllowPaging="True"
                                                    OnPageIndexChanging="gvGood_PageIndexChanging">
                                                    <Columns>
                                                        <asp:BoundField DataField="ID" Visible="False" />
                                                        <asp:TemplateField HeaderText="商品图片">
                                                            <ItemTemplate>
                                                                <a href="Default.aspx?PN=goods_details&ID=<%#Eval("ID") %>">
                                                                    <asp:Image alt='<%#Eval("GoodName_CN") %>' ID="imgGoodPic" runat="server" onerror="this.src='UpFile/Goods/NoPicture.jpg'"
                                                                        Width="80px" Height="80px" ImageUrl='<%# Eval("FilePic_Small") %>' /></a>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="GoodNo" HeaderText="商品编号" />
                                                        <asp:BoundField DataField="GoodName_CN" HeaderText="商品名称" />
                                                        <asp:HyperLinkField DataTextField="GoodNorm" HeaderText="商品规格" />
                                                        <asp:HyperLinkField DataTextField="GoodColor" HeaderText="商品颜色" />
                                                        <asp:BoundField DataField="Price_Orig" HeaderText="普通价格" />
                                                        <asp:BoundField DataField="Price_Vip" HeaderText="会员价" />
                                                        <asp:TemplateField HeaderText="数量">
                                                            <ItemTemplate>
                                                                &nbsp;<asp:TextBox ID="txtNum" runat="server" Text='<%# Eval("Amount") %>' onkeyup="value=value.replace(/[^\d]/g,'');updateQuantity(this.value)"
                                                                    Width="39px"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="SumMoney" HeaderText="金额" />
                                                        <asp:TemplateField HeaderText="删除">
                                                            <EditItemTemplate>
                                                                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                                                            </EditItemTemplate>
                                                            <ItemTemplate>
                                                                &nbsp;<asp:ImageButton ID="ibDelete" runat="server" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr><td><hr /></td></tr>
                            <tr>
                                <td bgcolor="#FFFFFF">
                                   
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        
                                        <tr>
                                            <td id="tdtotal" runat="server" align="right">
                                                <asp:Label ID="lbGoodType" runat="server"></asp:Label>
                                                <br />
                                                <asp:Label ID="Label2" runat="server" Text="商品总金额(不含运费)："></asp:Label>
                                                <asp:Label ID="lbSum" runat="server" Text="0" ></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            
                            <tr><td></td></tr>
                            <tr>
                                <td bgcolor="white" height="28" valign="middle">
                                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td valign="middle">
                                                &nbsp;
                                            </td>
                                            <td style="height: 24px" valign="middle" id="tdBottom" runat="server" align="right">
                                                <a href="#">
                                                    <img alt="" src="http://about" border="0" onclick="Del()" id="imgdel" runat="server" /></a>&nbsp;&nbsp;&nbsp;
                                                <a href="#">
                                                    <img src="http://about" border="0" onclick="window.location='Default.aspx'" id="imggood"
                                                        runat="server" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <asp:ImageButton ID="ibNext" runat="server" OnClick="ibNext_Click1" />
                                            </td>
                                        </tr>
                                    </table>
                                    <div style="height: 7px;">
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="round">
                        <div class="lround">
                        </div>
                        <div class="rround">
                        </div>
                    </div>
                </div>
            </div>
        </td>
    </tr>
</table>
<input id="hID" type="hidden" runat="server" />
<asp:HiddenField ID="hCartType" runat="server" />
<!-- 哪个购物车 -->
